<?php

use think\migration\Migrator;
use think\migration\db\Column;

class CreateWalletLog extends Migrator
{
    public function up(){
        $table = $this->table('wallet_log',['signed' => false,'comment'=>'钱包变动日志表']);
//        $table->addColumn('record_sn','string',['limit'=>32,'comment'=>'交易流水 关联钱包记录表 record_sn'])
//              ->addIndex(['record_sn'],['unique'=>true])
//              ->addColumn('user_id','integer',['limit'=>10,'comment'=>'用户id'])
//              ->addForeignKey('user_id','user','id', ['delete'=> 'CASCADE'])
//              ->addColumn('change_money','decimal',['precision'=>10,'scale'=>2,'default'=>0.00,'comment'=>'变动金额'])
//              ->addColumn('able_money','decimal',['precision'=>10,'scale'=>2,'default'=>0.00,'comment'=>'变动后的金额 可用金额'])
//             ->addColumn('remark','string',['limit'=>255,'default'=>'','comment'=>'备注'])
//             ->addColumn('create_time','integer',['default'=>0,'limit'=>10,'comment'=>'创建时间'])
//             ->create();

    }

    public function down(){
        $this->dropTable('wallet_log');
    }
}
